

(ugen-eq? (SinOsc.ar) (SinOsc.ar))	; => #f

(let ((u (SinOsc.ar)))
  (ugen-eq? u u))			; => #t

(define u 
  (Out.ar 
   0 
   (CombN.ar 
    (SinOsc.ar 
     (MIDICPS 
      (LFSaw.kr 0.4 0 24 (LFSaw.kr '(8 7.23) 0 3 80))) 0 0.1) 0.2 0.2 4)))

(structure-print (ugen-graph-close u))

(ugen-graph-constant-values u)

(define u (Out.ar 0 (Pan2.ar (SinOsc.ar 440 0 0.1))))

(structure-print u)

(map ugen-name/user (ugen-graph-ordering u))

(ugen-graph-elements u)

(ugen-graph-constants u)

(ugen-graph-controls u)

(map structure-print (ugen-graph-controls u))

(ugen-graph-ugens u)

(map ugen-name/user (ugen-graph-ugens u))

(ugen-graph-ordering u)

(map ugen-index (ugen-graph-ordering u))

(map constant-index (ugen-graph-constants u))

(define u* (ugen-graph-rewrite/root u))

(structure-print u*)

(map ugen-index (ugen-graph-ordering u*))

(map constant-index (ugen-graph-constants u*))

(define l (let* ((shared (PinkNoise.ar))
		 (a (HPF.ar shared))
		 (c (BPF.ar shared))
		 (b (LPF.ar (Add a c)))
		 (d (Mul b c))
		 (e (Abs a)))
	    (list e d)))

(for-each structure-print l)

(ugen-graph-constants/multiple-root l)

(map ugen-name/user (ugen-graph-ordering/multiple-root l))

(define u 
  (Out.ar 
   0 
   (CombN.ar 
    (SinOsc.ar 
     (MIDICPS 
      (LFSaw.kr 0.4 0 24 (LFSaw.kr '(8 7.23) 0 3 80))) 0 0.1) 0.2 0.2 4)))

(ugen-graph-rewrite/inputs u (lambda (i) (structure-print i) i))

(structure-print u)

(define g (ugen-graph->graphdef "Test" u))

(structure-print g)

(graphdef-encode g)

(synthdef-draw g)

(define u (Out.ar 0 (SinOsc.ar 440 0 0.1)))

(structure-print u)

(define u* (ugen-graph-rewrite 
	    u 
	    (ugen-graph-ordering u) 
	    (constant-set/indices (ugen-graph-constants u))))

(structure-print u*)

(define u
  (match (make-control-set '((freq 800 0 1)))
	 ((list freq)
	  (Out.ar 0 (SinOsc.ar freq 0 0.1)))))

(map ugen-name/user (ugen-graph-ordering u))

(for-each structure-print (ugen-graph-elements u))

(define u
  (match 
   (make-control-set '((bufnum 0 0 1)))
   ((list bufnum)
    (Out.ar 0 
	    (Pan2.ar 
	     (PlayBuf.ar 1 
			 bufnum
			 (Mul (Mul (MouseY.kr 4 0.25 1) (Rand.ir 0.95 1.05)) 
			      (BufRateScale.kr bufnum))
			 1
			 (Mul (Add (MouseX.kr 0 1) (Rand.ir -0.05 0.05)) 
			      (BufSamples.kr bufnum))
			 1)
	     (IRand.ir -1 1)
	     (EnvGen.kr envelope: (Env '(0 0.8 0) '(0.05 0.05)) 
			gate: 1 
			doneAction: 2))))))

(structure-print u)

(define u
  (match 
   (make-control-set '((freq (440 660) 0 1) 
		       (amp (1/8 1/6) 0 1)))
   ((list freq amp)
    (Out.ar 0 (SinOsc.ar freq 0 amp)))))
